var o = require("G"),
    i = !0;
cc.Class({
    extends: cc.Component,
    properties: {
        overLayer: cc.Node,
        game: cc.Node,
        videoBtn: cc.Button,
        shareBtn: cc.Button
    },
    fail: function (t) {
        // this.score = t, this.node.active = !0, o.config ? (console.log("测试"), this.shareBtn.active = !1) : (console.log("正式"),
        //     this.gameCount = o.LocalStorage.get("gamecount"), console.log("当前为下载游戏后的第 ", this.gameCount + 1, " 局"),
        //     this.gameCount < 2 ? (console.log("是前2局，隐藏share按钮"), this.shareBtn.node.active = !1) : (o.Interface.isOkVideo() || (i = !0),
        //         i ? (this.shareBtn.node.active = !0, this.videoBtn.node.active = !1, i = !i) : (this.videoBtn.node.active = !0,
        //             this.shareBtn.node.active = !1)));
        // 先直接显示失败界面
        this.node.active = !0;
    },
    reviveByVideo: function () {
        cc.director.emit("clickSound"), o.Interface.isOkVideo() ? o.Interface.showRewardedAD(function () {
            this.revive();
        }.bind(this)) : o.Interface.hitBox("暂无广告播放，请稍后再试");
    },
    reviveByShare: function () {
        cc.director.emit("clickSound");
        var t = parseInt(o.serverTime);
        o.Interface.share({
            utc: t,
            type: 2
        }), o.t1 = Date.parse(new Date());
    },
    revive: function () {
        var t = o.LocalStorage.get("reviveTime");
        o.LocalStorage.set("reviveTime", --t), this.node.active = !1, console.log("复活"),
            this.game.getComponent("Game").play();
    },
    skip: function () {
        console.log("失败，点击跳过");
        cc.director.emit("clickSound"), o.score = this.score, o.LocalStorage.set("level", 1),
            o.LocalStorage.set("score", 0), o.LocalStorage.set("gamecount", ++this.gameCount),
            this.node.active = !1, this.overLayer.active = !0;
    }
})